#pragma once

#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/irqflags.h>
#include <asm/ptrace.h>
#include <linux/hardirq.h>

struct softirq_action
{
    void (*action)(void);
};

enum
{
    HI_SOFTIRQ = 0,
    TIMER_SOFTIRQ,
    NET_TX_SOFTIRQ,
    NET_RX_SOFTIRQ,
    BLOCK_SOFTIRQ,
    IRQ_POLL_SOFTIRQ,
    TASKLET_SOFTIRQ,
    SCHED_SOFTIRQ,
    HRTIMER_SOFTIRQ,
    RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */

    NR_SOFTIRQS
};

void open_softirq(int nr, void (*action)(void));

void __do_softirq(void);

#ifndef local_softirq_pending

#ifndef local_softirq_pending_ref
#define local_softirq_pending_ref irq_stat.__softirq_pending
#endif

unsigned local_softirq_pending(void);
void set_softirq_pending(unsigned x);
void or_softirq_pending(unsigned x);

#endif /* local_softirq_pending */

extern void __raise_softirq_irqoff(unsigned int nr);
